var Conf = (function(){
	/* private property */
	var _gameWidth = 320;
	var _gameHeight = 320;
	var _frameRate = 15;
	var _initialScore = 0;
	var _waveInterval = 10 * _frameRate;
	var _mapWidth = 16;
	var _mapHeight = 16;
	var _mapLoadDataField;
	var _mapLoadDataBuildingAndItem;
	var _mapCollisionData;
	var _foreGrdMapLoadData;
	
	return {
		getGameWidth : function(){
			return _gameWidth;
		},
		getGameHeight : function(){
			return _gameHeight;
		},
		getFrameRate : function(){
			return _frameRate;
		},
		getInitialScore : function(){
			return _initialScore;
		},
		getWaveInterVal : function(){
			return _waveInterval;
		},
		getMapWidth : function(){
			return _mapWidth;
		},
		getMapHeight : function(){
			return _mapHeight;
		},
		getMapLoadDataField : function(){
			return _mapLoadDataField;
		},
		setMapLoadDataField : function(mapLoadDataField){
			_mapLoadDataField = mapLoadDataField;
		},
		getMapLoadDataBuildingAndItem : function(){
			return _mapLoadDataBuildingAndItem;	
		},
		setMapLoadDataBuildingAndItem : function(mapLoadDataBuildingAndItem){
			_mapLoadDataBuildingAndItem = mapLoadDataBuildingAndItem;
		},					
		getMapCollisionData : function(){
			return _mapCollisionData;	
	        },
		setMapCollisionData : function(mapCollisionData){
			_mapCollisionData = mapCollisionData;
		},					
		getForeGrdMapLoadData: function(){
			return _foreGrdMapLoadData;
	        },
		setForeGrdMapLoadData : function(foreGrdMapLoadData){
			_foreGrdMapLoadData = foreGrdMapLoadData;
		},					


		

	}
	
	
})();

/* set map data */
var mapLoadDataField =  [
   [322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,342,342,342,342,342,342,342,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,342,342,342,342,342,342,342,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,342,342,342,342,342,342,342,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,342,342,342,342,342,342,342,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,342,342,342,342,342,342,342,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,342,342,342,342,342,342,342,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,342,342,342,341,341,341,342,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,322, 25,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,322, 45,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,322,  7,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,322, 44,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322],
   [322, 44, 45, 48, 44,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322],
   [322, 47,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322],
   [322, 44,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322],
   [322, 48,44 , 25, 26,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,322, 46,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322],
   [322,322,322,322, 46,322,322,322,322,322,322,322,322,322,322,322,322,322,322,322]
];
Conf.setMapLoadDataField(mapLoadDataField);

var mapLoadDataBuildingAndItem =  [
    [ -1,461,462, -1,461,462, -1,461,462,421,461,462,461,462,461,462,461,462,461,462],
    [ -1,481,482, -1,481,482,421,481,482,421,481,482,481,482,481,482,481,482,481,482],
    [ -1,421,421,321,341,341,341,341,341,321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1,461,462,321,422, -1, -1,400,400,321,461,462,461,462,461,462,461,462,461,462],
    [ -1,481,482,321, -1, -1, -1, -1,400,321,481,482,481,482,481,482,481,482,481,482],
    [ -1, -1, -1,321,521,521,521,521,521,321,421, -1,421, -1,421, -1,421, -1,421, -1],
    [ -1,461,462,321, -1, -1, -1, -1, -1,321,461,462,461,462,461,462,461,462,461,462],
    [ -1,481,482,321, -1, -1, -1, -1, -1,321,481,482,481,482,481,482,481,482,481,482],
    [ -1, -1, -1,341,420, -1, -1, -1, -1,341,421, -1,421, -1,421, -1,421, -1,421, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1,421,421, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,461,462,461,462,461,462,461,462,461,462],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,481,482,481,482,481,482,481,482,481,482],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
 ];
 Conf.setMapLoadDataBuildingAndItem(mapLoadDataBuildingAndItem);
 
var mapCollisionData = [
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  1,  1,  0,  1,  1,  0,  1,  1,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1],
    [  0,  0,  0,  1,  1,  1,  1,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  1,  0,  0,  0,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  1,  1,  1,  0,  0,  0,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1],
    [  0,  0,  0,  1,  1,  1,  1,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  1,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  1,  1,  1,  0,  0,  0,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1],
    [  0,  0,  0,  1,  0,  0,  1,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  1,  0,  1,  0,  1],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0]
];
Conf.setMapCollisionData(mapCollisionData);

var foreGrdMapLoadData= [
    [ -1,461,462, -1,461,462, -1,461,462, -1,461,462,461,462,461,462,461,462,461,462],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1,461,462, -1, -1, -1, -1, -1, -1, -1,461,462,461,462,461,462,461,462,461,462],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1,461,462, -1, -1, -1, -1, -1, -1, -1,461,462,461,462,461,462,461,462,461,462],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,461,462,461,462,461,462,461,462,461,462],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
    [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]
];
Conf.setForeGrdMapLoadData(foreGrdMapLoadData);
	
